Sets how big the room’s zoomable background is drawn: 1 is its real size, 2 is twice as big, 0.5 is half as big.
Game Boy: not available
Game Boy Color: not available
Sega Genesis: not available
On other consoles this differs: see Side by side and How the consoles differ.
zoom_background_scale(scale)| Name | Type |
|---|---|
scale | real |
Nothing.
Sets how big the room's zoomable background is drawn. 1 is the picture's real size, 2 is twice as big, 0.5 is half as big. It does nothing in a room that has no zoomable background.
The picture grows and shrinks around the focus point, which is the middle of the screen until zoom_background_focus says otherwise. Whatever is under the focus point stays exactly where it is while everything else moves toward it or away from it. That is what makes zooming a map feel right: you zoom in on what you are looking at.
The number is held between 1/16 and 16. The hardware cannot draw a scale of 0, or less than 0, and past that range its own numbers run out, so a number outside it is moved to the nearest end.
This zooms the picture only. Sprites and instances keep their size. If something should grow along with the map, a marker for the player, say, scale it yourself with xscale and yscale, using the same number.
// Step event of the object that runs the map screen. R zooms in, L zooms out.
// This object keeps the zoom in its own xscale, so there is nothing to set up first.
if (btn_held(BTN_R)) { xscale *= 1.03; }
if (btn_held(BTN_L)) { xscale /= 1.03; }
zoom_background_scale(xscale);Each frame R is held the picture grows by 3 percent, and each frame L is held it shrinks by the same, so the zoom speeds up as you go, which feels natural for a map. Any number you keep will do: xscale is only used here because every object already has one.
A no-op in a room that has no zoomable background. The picture grows or shrinks about the focus point (the middle of the screen unless zoom_background_focus says otherwise), so whatever is under the focus stays where it is. Held between 1/16 and 16: the hardware cannot draw a scale of 0 or less, and past that range its numbers run out. This zooms the PICTURE only: sprites and instances keep their size (draw_sprite_scaled and the xscale / yscale variables resize those).